package com.bugk.aop;

import com.bugk.pojo.BeanDemo;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.scheduling.annotation.Async;

import javax.annotation.PostConstruct;


public class UserServiceImpl implements InitializingBean, ApplicationContextAware {

	private BeanDemo beanDemo;

	public void setBeanDemo(BeanDemo beanDemo) {
		this.beanDemo = beanDemo;
	}

	public void hello() {
		System.out.println("hello, spring...");
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println("InitializingBean execute...");
	}

	@PostConstruct
	public void postConstruct() {
		System.out.println("@PostConstruct execute...");
	}

	public void initMethod(){
		System.out.println("initMethod execute...");
	}

	@Async
	public void asyncMethod(){
		System.out.println("asyncMethod execute...");
	}

	public void saveUser(){
		System.out.println("saveUser execute...");
	}

	public void noProxyMethod(){
		System.out.println("noProxyMethod execute...");
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {

	}
}
